﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Newtonsoft.Json;

namespace StevensReceipts.Domain
{
    /// <summary>
    /// group chart of account type to different category
    /// the set of categories:
    /// 1. Asserts
    /// 2. Liabilities
    /// 3. Expenses
    /// 4. Equity
    /// 5. Revenue
    /// </summary>
    public class ChartofAccountCategory : IEntity
    {


        //unique identifier
        [Key]
        public int Id { get; set; }
        //name of the chart of account category
        [StringLength(50)]
        public string Name { get; set; }
        //list of chart of account types belong to this category
        [JsonIgnore]
        public virtual ICollection<ChartofAccountAccountType> Types { get; set; }
        [JsonIgnore]
        public virtual ICollection<TaxRate> DefaultTaxRates { get; set; }


        public DateTime? Created { get; set; }

        public DateTime? Modified { get; set; }

        public ChartofAccountCategory()
        {
            Types = new HashSet<ChartofAccountAccountType>();
            DefaultTaxRates = new HashSet<TaxRate>();
            Created = DateTime.Now;
        }
    }
}